<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <link href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
    <script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
    <title></title>
    <style>
        img{max-width: 120px;}
    </style>
</head>
<body>
<div class="table-responsive">
    <table class="table table-bordered table-striped">
        <thead>
        <tr>
            <th></th>
            <th>
                名字
                <small>name</small>
            </th>
            <th>
                图标
                <small>icon </small>
            </th>
            <th>
                描述
                <small>desc</small>
            </th>
            <th>
                开始时间
                <small>start</small>
            </th>
            <th>
                需要多少玩家报名
                <small>minuser</small>
            </th>
            <th>
                持续多久
                <small>last</small>
            </th>
            <th>
                默认多少筹码
                <small>gold</small>
            </th>
        </tr>
        </thead>
        <tbody>

        <tr>
            <th class="text-nowrap"><code>.container</code></th>
            <td>None （自动）</td>
            <td>750px</td>
            <td><img src="icons/p512new.png"></td>
            <td>1170px</td>
            <td>750px</td>
            <td>970px</td>
            <td>1170px</td>
        </tr>

        </tbody>
    </table>


    <script>


        // 获取数据
        function getData(){
            $.ajax({
                type: "get",
                url: "show.php",
                data: { page: "0"}
            }).done(function( data ) {
                showTable(eval('(' + data + ')'));
            });
        }

        // 拼接 table 列表
        function showTable(data){
            var html="";
            $.each(data,function(index, value){
                html+="<tr>" +
                "<th class='text-nowrap'><code>"+ value.seasonid+ "</code></th>" +
                "<td>"+value.name+"</td>" +
                "<td><img src='icons/"+value.icon+"'></td>" +
                "<td>"+value.desc+"</td>" +
                "<td>"+value.start+"</td>" +
                "<td>"+value.minuser+"</td>" +
                "<td>"+value.last+"</td>" +
                "<td>"+value.gold+"</td>" +

                "</tr>";
            });
            $("tbody").html(html);
        }


        getData();

    </script>

</div>
</body>
</html>